package com.wgy.day17.封装性.方法就是一种封装;

/**
 * Created by pc on 2020/11/11 20:31
 * Description: LearningJava
 */
public class Demo01Method {
    public static void main(String[] args) {
        int[] array = {15, 25, 35, 100};
        int num = getMax(array);
        System.out.println(num);

    }

    public static int getMax(int[] array) {
        int max = array[0];
        for (int i = 0; i < array.length; i++) {
            if (array[i] > max) {
                max = array[i];
            }
        }
        return max;
    }

}
